<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    {include file="common/head" /}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <table class="layui-table" lay-even>
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
            <tr>
                <td>ID</td>
                <td>{$info.id}</td>
            </tr>
            <tr>
                <td>订单用户</td>
                <td>{$info['user']['mobile']}</td>
            </tr>
            <tr>
                <td>订单号</td>
                <td>{$info['order_number']}</td>
            </tr>
            <tr>
                <td>服务项目</td>
                <td>{$info['service']['title']}</td>
            </tr>
            <tr>
                <td>汽车品牌</td>
                <td>{$info.brand_name|default='-'}</td>
            </tr>
            <tr>
                <td>汽车系列</td>
                <td>{$info.series_name|default='-'}</td>
            </tr>

            <tr>
                <td>汽车型号</td>
                <td>{$info.car_name|default='-'}</td>
            </tr>
            <tr>
                <td>联系人</td>
                <td>{$info.real_name}</td>
            </tr>

            <tr>
                <td>联系人电话</td>
                <td>{$info.mobile}</td>
            </tr>
            <tr>
                <td>陪同时间</td>
                <td>{$info.go_time|date='Y-m-d H:i:s'}</td>
            </tr>
            <tr>
                <td>陪同地址</td>
                <td>{$info.address}</td>
            </tr>
            <tr>
                <td>创建订单时间</td>
                <td>{$info['create_time']}</td>
            </tr>
            <tr>
                <td>支付状态</td>
                <td>{$info['status']?'已支付':'未支付'}</td>
            </tr>
            <tr>
                <td>支付时间</td>
                <td>{$info.pay_time?date('Y-m-d H:i:s',$info['pay_time']):'-'}</td>
            </tr>
            <tr>
                <td>服务状态</td>
                <td>{$info.order_type?'已服务':'未服务'}</td>
            </tr>
            <tr>
                <td>服务完成时间</td>
                <td>{$info.finish_time?date('Y-m-d H:i:s',$info['finish_time']):'-'}</td>
            </tr>
            </tbody>
        </table>

    </div>
</div>

<div id="idbox" style="display: none">

</div>
<script>layui.use(['form', 'layer'],
    function () {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

        //自定义验证规则
        form.verify({
            mobile: function (value) {
                if (!new RegExp("^1[3456789]\\d{9}$").test(value)) {
                    return '请填写正确的手机号';
                }
            },

            pwd: function (value) {
                if (value.len<6) {
                    return '密码请设置6位以上的字符';
                }
            }
        });

        //监听提交
        form.on('submit(add)',
            function (data) {
                $.ajax({
                    type: "POST",
                    url: "{:url()}",
                    data: data.field,
                    success: function (result) {

                        if(result.code){
                            layer.alert(result.msg, {
                                icon: 6
                            }, function () {
                                xadmin.close();
                            });
                        }else{
                            layer.alert(result.msg,{
                                icon: 2
                            });
                        }

                    },
                    error: function (result) {
                        layer.alert(result.msg, {
                            icon: 2
                        }, function () {
                            xadmin.close();
                        });
                    }

                });
                return false;
            });


    });
</script>

</body>

</html>
